Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the column name as descriptor instead of the selector #989

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

0ctanium
Copy link

@0ctanium 0ctanium commented Nov 8, 2021

closes #988

@@ -336,7 +336,7 @@ func (s *session) inferParamAndResultCols(statement string) ([]*schema.Column, [
return nil, nil, err
}
for _, c := range cols {
resCols = append(resCols, &schema.Column{Name: c.Selector(), Type: c.Type})
resCols = append(resCols, &schema.Column{Name: c.Column, Type: c.Type})
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the database/sql descriptor is the descriptor that is exposed to the client.
But for this one I don't really know what its usage is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if just the column name is used then queries like "select t1.id, t2.id ..." could lead to wrong interpretations, that's why full descriptor "db.table.col" is used instead... but the final layer may provide a way to just fetch the column name, or some way of dealing with such conflicts...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return only column name to client (SDK)
2 participants